package cn.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;

import cn.pojo.Sort;
import cn.service.SortService;

@Controller
@RequestMapping("/sort")
public class SortController {
	@Resource
	private SortService sortService;

	// 获得所有讨论版区分类表的信息
	@RequestMapping(value = "/getAllSorts", produces = "application/json;charset=utf-8")
	@ResponseBody
	public String getAllSorts() {
		List<Sort> list = sortService.getAllSorts();
		String json = JSON.toJSONString(list);
		return json;
	}

	// 发帖操作:addSort
	@RequestMapping("/addSort")
	public String toUserAdd() {
		return "addSort";
	}

}
